import { ref } from 'vue'
import { deleteOaEmpById } from '@/api/basic'

/**
 * OA账号删除服务
 */
export default function () {
  const oaEmpDeleteLoading = ref(false)

  const oaEmpDelete = async (oaEmpId: string) => {
    try {
      oaEmpDeleteLoading.value = true
      const res = await deleteOaEmpById(oaEmpId)
      oaEmpDeleteLoading.value = false
      return res.data
    } catch (e) {
      oaEmpDeleteLoading.value = false
    }
  }

  return {
    oaEmpDeleteLoading,
    oaEmpDelete,
  }
}
